negotiator.utility
Class EvaluatorReal

java.lang.Object
  extended by negotiator.utility.EvaluatorReal
All Implemented Interfaces:
Evaluator

public class EvaluatorReal
extends java.lang.Object
implements Evaluator

An evaluator for real-type issues.

Author:
Dmytro Tykhonov

Constructor Summary
EvaluatorReal()
           
 
Method Summary
 void addParam(int index, double value)
           
 EvaluatorReal clone()
           
 boolean equals(java.lang.Object obj)
           
 double getConstantParam()
           
 java.lang.Double getEvaluation(double pValue)
           
 java.lang.Double getEvaluation(UtilitySpace uspace, Bid bid, int index)
          This method returns the utility of the value of an issue.
 EVALFUNCTYPE getFuncType()
           
 double getLinearParam()
           
 double getLowerBound()
           
 Value getMaxValue()
           
 Value getMinValue()
           
 double getTopParam()
           
 EVALUATORTYPE getType()
           
 double getUpperBound()
           
 double getValueByEvaluation(double pUtility)
           
 double getWeight()
           
 int hashCode()
           
 java.lang.String isComplete(Objective whichobj)
          Check whether the evaluator has enough information to make an evaluation.
 void loadFromXML(SimpleElement pRoot)
          Method to
 void lockWeight()
          Locks the weight of this Evaluator.
 void setConstantParam(double par0)
          Sets the constant parameter for the evaluation function and changes the ftype of this evaluator to "constant"
 void setftype(java.lang.String ft)
          Sets the evaluator function type.
 void setLinearParam(double par1)
          Sets the linear parameter for the evaluation function and changes the ftype of this evaluator to "linear".
 void setLowerBound(double lf)
          Sets the lower bound for this evaluator.
 void setType(EVALFUNCTYPE pType)
           
 void setUpperBound(double ub)
          Sets the upper bound for this evaluator
 void setWeight(double wt)
          Sets the weigth with which an Objective or Issue is evaluated.
 SimpleElement setXML(SimpleElement evalObj)
          Sets weights and evaluator properties for the object in SimpleElement representation that is passed to it.
 void unlockWeight()
          Unlock the weight of this evaluator.
 boolean weightLocked()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvaluatorReal

public EvaluatorReal()
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getWeight

public double getWeight()
Specified by:
getWeight in interface Evaluator
Returns:
the weight associated with this

setWeight

public void setWeight(double wt)
Description copied from interface: Evaluator
Sets the weigth with which an Objective or Issue is evaluated.

Specified by:
setWeight in interface Evaluator
Parameters:
wt - The new weight.

lockWeight

public void lockWeight()
Locks the weight of this Evaluator.

Specified by:
lockWeight in interface Evaluator

unlockWeight

public void unlockWeight()
Unlock the weight of this evaluator.

Specified by:
unlockWeight in interface Evaluator

weightLocked

public boolean weightLocked()
Specified by:
weightLocked in interface Evaluator
Returns:
The state of the weightlock.

getEvaluation

public java.lang.Double getEvaluation(UtilitySpace uspace,
                                      Bid bid,
                                      int index)
Description copied from interface: Evaluator
This method returns the utility of the value of an issue. Note that the value is not multiplied by the issue weight, and is therefore non-normalized.

Specified by:
getEvaluation in interface Evaluator
Parameters:
uspace - preference profile
bid - in which the value is contained.
index - of the issue in the bid.
Returns:
utility of the value for an issue, not normalized by the issue weight.

getEvaluation

public java.lang.Double getEvaluation(double pValue)

getValueByEvaluation

public double getValueByEvaluation(double pUtility)

getType

public EVALUATORTYPE getType()
Specified by:
getType in interface Evaluator
Returns:
type of evaluation function, for example EVALUATORTYPE.LINEAR.

getFuncType

public EVALFUNCTYPE getFuncType()

getLowerBound

public double getLowerBound()

getUpperBound

public double getUpperBound()

setLowerBound

public void setLowerBound(double lf)
Sets the lower bound for this evaluator.

Parameters:
lf - The new lower bound.

setUpperBound

public void setUpperBound(double ub)
Sets the upper bound for this evaluator

Parameters:
ub - The new upper bound

setftype

public void setftype(java.lang.String ft)
Sets the evaluator function type.

Parameters:
ft - The new type, either "linear" or "constant"

setLinearParam

public void setLinearParam(double par1)
Sets the linear parameter for the evaluation function and changes the ftype of this evaluator to "linear".

Parameters:
par1 - The new linear evaluation parameter.

getLinearParam

public double getLinearParam()
Returns:
The linear parameter of this Evaluator, or 0 if it doesn't exist.

setConstantParam

public void setConstantParam(double par0)
Sets the constant parameter for the evaluation function and changes the ftype of this evaluator to "constant"

Parameters:
par0 - The new constant evalutation parameter.

getConstantParam

public double getConstantParam()
Returns:
The constant parameter of this Evaluator, or 0 if it doesn't exist.

getTopParam

public double getTopParam()
Returns:
The top parameter of this Evaluator, or 0 if it doesn't exist.

loadFromXML

public void loadFromXML(SimpleElement pRoot)
Description copied from interface: Evaluator
Method to

Specified by:
loadFromXML in interface Evaluator

setXML

public SimpleElement setXML(SimpleElement evalObj)
Sets weights and evaluator properties for the object in SimpleElement representation that is passed to it.

Parameters:
evalObj - The object of which to set the evaluation properties.
Returns:
The modified simpleElement with all evaluator properties set.

isComplete

public java.lang.String isComplete(Objective whichobj)
Description copied from interface: Evaluator
Check whether the evaluator has enough information to make an evaluation.

Specified by:
isComplete in interface Evaluator
Parameters:
whichobj - is the objective/issue to which this evaluator is attached.
Returns:
String describing lacking component, or null if the evaluator is complete.

getMaxValue

public Value getMaxValue()

getMinValue

public Value getMinValue()

addParam

public void addParam(int index,
                     double value)

setType

public void setType(EVALFUNCTYPE pType)

clone

public EvaluatorReal clone()
Specified by:
clone in interface Evaluator
Overrides:
clone in class java.lang.Object
Returns:
clone of the current object.